<template>
    <div>
        <div><router-link to="/">返回</router-link></div>
        {{msgaaaa}}
        <div>
            <ul>
                <li v-for="(indexs,index) in inde" :key="index">
                    <router-link :to="{path:'/cnode',query:{itme:indexs.title,content:indexs.content,id:indexs.id}}">
                    <div class="title">
                        <img :src=indexs.author.avatar_url alt="">
                        <span>{{indexs.reply_count}}/{{indexs.visit_count}}</span>
                        <h3>{{indexs.title}}</h3>
                    </div>
                    </router-link>
                </li>
            </ul>
        </div>
    </div>
</template>

<style scoped>
a{
    color: #333;
     text-decoration:none;
     /* out-line: none; */
}
li{
    border-bottom:1px solid #333;
}
.title{
    display: flex;
    justify-content: flex-start;
}
.title span{
    display: block;
    width: 100px;
    line-height: 60px;
}
.contents{
    width: 100%;
    height: 60px;
    overflow: hidden;
}
img{
    width: 50px;
    height: 50px;
    margin: 5px;
}
</style>

<script>
import { error } from 'util';
export default {
    name:'ask',
    data(){
        return{
          msgaaaa: new Date().toLocaleString(),
          inde:[],
          page:"",
        }
    },
    created(){
        this.$axios.get('https://cnodejs.org/api/v1/topics',{
            // method:'get',
            // url:' https://cnodejs.org/api/v1/topics',
            params:{
                page:this.page,
                limit:'20',
                tab:'ask'
            }
        }).then((response)=>{
            console.log(this.page)
            console.log(response)
           this.inde=response.data.data;
        }).catch((error)=>{
            console.log(error)
        })
    },
}


</script>
